 |
 |
 |
 |
 |
 |
 |
 |
|
The
point of reference variables and functions
|
|
 |
|
|
|
|
|
is that you can
pass a variable as a parameter
|
|
|
and have the
variable changed in the function.
|
|
|
int &ref = x;
|
|
|
|
This
is all assuming we have a variable called x
|
 |
|
|
|
and that it is
also an integer (int). But after
|
|
|
doing this,
anything we do to ref will effect x.
|
|